<?php
class media_draft_log_model extends CI_Model {

	public function __construct(){
		parent::__construct();
		$this->db = $this->load->database('default',true);
	}

	public function insert_log($media_draft_id,$action_type,$create_by,$create_time,$explanation,$differents){
		$data=array('create_by'=>$create_by,
				'create_time'=>$create_time,
				'explanation'=>$explanation,
				'media_draft_id'=>$media_draft_id,
				'action_type'=>$action_type,
				'differents'=>$differents
		);
		$this->db->insert("media_draft_log",$data);
	}
	public function get_logs($media_draft_id){
		$sql ="select * from media_draft_log where media_draft_id='$media_draft_id'";
		$query =$this->db->query($sql);
		if ($query) {
			return $query->result_array();
		}
	}
	
	public function delete_log($media_draft_id){
		$sql ="delete from media_draft_log where media_draft_id='$media_draft_id'";
		$this->db->query($sql);
	}
}